 <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/metro-gray/easyui.css"/>
<link rel="stylesheet" href="static/easyui/themes/icon.css"/>
<title>处方开药</title>
</head>
<body> 
<script type="text/javascript">
	function tuihuoxq(a){
		$("#thxq").window("open");
		//访问数据源、初始化表格
		$('#ypxq').datagrid({
			url:'ypsy',
			queryParams:{
				thid:a
			},
			columns:[[
				{field:'ypid',title:'药品id',width:100},
				{field:'ypname',title:'药品名称',width:100,align:'right'},
				{field:'yppc',title:'药品批次',width:100,align:'right'}
					]]
			});
	
	}
	$(function(){
		//访问数据源、初始化表格
		$('#thsy').datagrid({
			url:'ypth',
			columns:[[
				{field:'thid',title:'退货编号',width:100},
				{field:'cfid',title:'退货处方编号',width:100},
				{field:'thtime',title:'退货时间',width:100,align:'right'},
				{field:'jbr',title:'经办人',width:100,align:'right'},
				{field:'thly',title:'退货理由',width:100,align:'right'},
				{field:'cz',title:'操作*',width:200,
					formatter:function(value,row,index){
						return "<input type='button' onclick='tuihuoxq("+row.thid+")' value='详情'/>";
					}	
				}
			]]
			});

	})
</script>
<div class="easyui-panel">
	<div class="easyui-panel" data-options="fit:true">
		<table id="thsy" class="easyui-datagrid" data-options="fitColumns:true,pagination:true"  style="height:400px">
			
		</table>
	</div>
	<div id="thxq" class="easyui-window" data-options="closed:true">
		<table id="ypxq" class="easyui-datagrid" data-options="fitColumns:true,pagination:true"  style="height:400px" width="400px">

		</table>
	</div>
	</div>
</body>
</html>